package com.example.travel_front.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

import com.example.travel_front.R;

public class FontActivity extends AppCompatActivity {

    private TextView textViewInfo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Set the content of the activity to use the XML layout file
        setContentView(R.layout.activity_font);

        // Initialize the TextViews
        textViewInfo = findViewById(R.id.textViewInfo);
        TextView textViewSmallA = findViewById(R.id.textViewSmallA);
        TextView textViewLargeA = findViewById(R.id.textViewLargeA);
        Button startButton = findViewById(R.id.startButton);
        startButton.setOnClickListener(v -> {
            Intent intent = new Intent(FontActivity.this, LoginActivity.class);
            startActivity(intent);
        });

        // Initialize the SeekBar and set a listener on it
        SeekBar fontSizeSeekBar = findViewById(R.id.fontSizeSeekBar);
        fontSizeSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                // Assuming the progress ranges from 0 to 100, and you want to set text size from 12sp to 30sp
                float textSize = 12 + (progress * (30 - 12) / 100);
                textViewInfo.setTextSize(textSize);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
                // You might want to do something when the user starts dragging the SeekBar
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                // You might want to do something when the user releases the SeekBar
            }
        });
    }
}
